/**
 * 
 */
package com.lvmama.vst.batis.datasource;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * 
 * DynamicDataSource
 * 
 * @author baolm
 *
 */
public class DynamicDataSource extends AbstractRoutingDataSource {

    @Override
    protected Object determineCurrentLookupKey() {
        
        // can do load balance for mutiRead data source hear.
        String currentDataSource = DataSourceContextHolder.getCurrentDataSource();
        logger.info("currentDataSource:" + currentDataSource);
        return currentDataSource;
    }

}
